/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package entityBeans;

import java.io.Serializable;
import java.util.List;
import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.OneToMany;
import javax.persistence.Table;

/**
 *
 * @author allankv
 */
@Entity
@Table(name = "scientificnameauthorship")
@NamedQueries({
    @NamedQuery(name = "Scientificnameauthorship.findAll", query = "SELECT s FROM Scientificnameauthorship s"),
    @NamedQuery(name = "Scientificnameauthorship.findByIdscientificnameauthorship", query = "SELECT s FROM Scientificnameauthorship s WHERE s.idscientificnameauthorship = :idscientificnameauthorship"),
    @NamedQuery(name = "Scientificnameauthorship.findByScientificnameauthorship", query = "SELECT s FROM Scientificnameauthorship s WHERE s.scientificnameauthorship = :scientificnameauthorship")})
public class Scientificnameauthorship implements Serializable {
    private static final long serialVersionUID = 1L;
    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    @Basic(optional = false)
    @Column(name = "idscientificnameauthorship")
    private Integer idscientificnameauthorship;
    @Basic(optional = false)
    @Column(name = "scientificnameauthorship")
    private String scientificnameauthorship;
    @OneToMany(mappedBy = "scientificnameauthorship", fetch = FetchType.LAZY)
    private List<Taxonomicelement> taxonomicelementList;

    public Scientificnameauthorship() {
    }

    public Scientificnameauthorship(Integer idscientificnameauthorship) {
        this.idscientificnameauthorship = idscientificnameauthorship;
    }

    public Scientificnameauthorship(Integer idscientificnameauthorship, String scientificnameauthorship) {
        this.idscientificnameauthorship = idscientificnameauthorship;
        this.scientificnameauthorship = scientificnameauthorship;
    }

    public Integer getIdscientificnameauthorship() {
        return idscientificnameauthorship;
    }

    public void setIdscientificnameauthorship(Integer idscientificnameauthorship) {
        this.idscientificnameauthorship = idscientificnameauthorship;
    }

    public String getScientificnameauthorship() {
        return scientificnameauthorship;
    }

    public void setScientificnameauthorship(String scientificnameauthorship) {
        this.scientificnameauthorship = scientificnameauthorship;
    }

    public List<Taxonomicelement> getTaxonomicelementList() {
        return taxonomicelementList;
    }

    public void setTaxonomicelementList(List<Taxonomicelement> taxonomicelementList) {
        this.taxonomicelementList = taxonomicelementList;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (idscientificnameauthorship != null ? idscientificnameauthorship.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof Scientificnameauthorship)) {
            return false;
        }
        Scientificnameauthorship other = (Scientificnameauthorship) object;
        if ((this.idscientificnameauthorship == null && other.idscientificnameauthorship != null) || (this.idscientificnameauthorship != null && !this.idscientificnameauthorship.equals(other.idscientificnameauthorship))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "entityBeans.Scientificnameauthorship[idscientificnameauthorship=" + idscientificnameauthorship + "]";
    }

}
